import 'package:decimal/decimal.dart';

class CalculateUtils {
  /// 加法运算
  ///
  /// return [num1] + [num2]
  static double addition(num num1, num num2) {
    return (Decimal.parse("$num1") + Decimal.parse("$num2")).toDouble();
  }

  /// 减法运算
  ///
  /// return [num1] - [num2]
  static double subtraction(num num1, num num2) {
    return (Decimal.parse("$num1") - Decimal.parse("$num2")).toDouble();
  }

  /// 乘法运算
  ///
  /// return [num1] * [num2]
  static double multiplication(num num1, num num2) {
    return (Decimal.parse("$num1") * Decimal.parse("$num2")).toDouble();
  }

  /// 除法运算
  ///
  /// return [num1] / [num2]
  static double division(num num1, num num2) {
    return (Decimal.parse("$num1") / Decimal.parse("$num2")).toDouble();
  }
}
